package com.woyou.ui.activity.orderlist;

import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.citaq.ideliver.R;
import com.woyou.bean.MyOrderItem;
import com.woyou.utils.DateUtils;

/**
 * @author blanks
 * @创建时间 2015年9月10日 下午5:36:07
 * @version v1.0
 */
public class DivisionItemView extends BaseItemView {

	private TextView orderDate;

	/**
	 * @param context
	 */
	public DivisionItemView(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		loadLayout();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.woyou.ui.adapter.packag.BaseItemView#loadLayout()
	 */
	@Override
	void loadLayout() {
		// TODO Auto-generated method stub
		LayoutInflater.from(getContext()).inflate(R.layout.item_myoder_lv_line, this);

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.woyou.ui.adapter.packag.BaseItemView#loadData(com.woyou.bean.
	 * MyOrderItem)
	 */
	@Override
	public void loadData(MyOrderItem data) {
		// TODO Auto-generated method stub
		orderDate = (TextView) findViewById(R.id.myorder_date);
		if (!TextUtils.isEmpty(data.oDate) && data.oDate.equals(DateUtils.getTodayDate())) {
			orderDate.setText("今天");
		} else if (!TextUtils.isEmpty(data.oDate) && data.oDate.equals(DateUtils.getYestoryDate())) {
			orderDate.setText("昨天");
		} else {
			orderDate.setText(data.oDate);
		}
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}

}
